//
//  TTAPI+Room.swift
//  TTBLL
//
//  Created by Toj on 5/11/21.
//

import Foundation

extension TTAPIRequest.API {
    
    /// 班课 - 房间信息
    static var roomInfoClass: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/broadcast/c/v1.0/roomInfo")
    }
    
    /// 1v1 - 房间信息
    static var roomInfo1v1: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/broadcast/roomInfo")
    }
    
    /// 线下课 - 房间信息
    static var roomInfoOffline: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/course/queryOfflineResource")
    }
    
    /// 录播课 - 房间信息
    static var roomInfoRecord: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/record/pad/step/info/v1.0/queryByTimeTable")
    }
    
    /// 进入房间 - 获取学生列表
    static var roomMembers: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/broadcast/queryClassMembers")
    }
    
    /// 上传选择题答案
    static var updateAnswer: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/broadcast/c/v1.0/noticeSelectAnswer")
    }
    
    /// 选择题信息
    static var queryAnswer: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/broadcast/c/v1.0/queryAnswerStatistics")
    }
    
    /// pano白板信息
    static var panoWhiteboard: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/broadcast/c/v1.0/panoRoomToken")
    }
    
    /// 上课打点
    static var timeReport: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/c/broadcast/v1.0/studentLessonTimeReport")
    }
    
    /// 退出聊天室
    static var quitChatRoom: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/broadcast/quitClassRoom")
    }
}

extension TTAPIRequest.API {
    
    /// 激励信息
    static var incentiveItemList: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/itcentive/queryAllIncenticeItem")
    }
    
    static var studentGiftID: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/gift/id")
    }
    
    static var studentSkinID: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/skin/id")
    }
    
    static var studentConfig: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/config")
    }
    
    static var studentOwnerConfig: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/owner/classConf")
    }
    
    static var studentAllGiftByUser: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/gift/findAllGiftByUser")
    }
    
    static var studentAllSkin: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/skin/findAllSkin")
    }
    
    static var studentSkinClientInit: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/skin/data/client/init")
    }
    
    static var medalID: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/medal/id")
    }
    
    static var studentExcitingScore: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/exciting/my/score")
    }
    
    static var studentGiftBuyAndGive: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/gift/buyAndGive")
    }
    
    static var accountMedalSend: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/account/medal/send")
    }
    
    static var studentSkinBuyAndUse: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/skin/buyAndUse")
    }
    
    static var excitingScoreReportUpload: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/student/exciting/score/report/upload")
    }
    
    static var accountMedalInfo: TTAPIRequest.API {
        return TTAPIRequest.API(rawValue: "/vts_v1/account/medal/info/id")
    }
}

extension TTAPI.Request {
    
    static func joinRoom(_ parameters:[String: Any]? = nil,
               completion:((_ response:TTResponse<TTWork>)->())?) {
        
        general(api: .works, model: TTWork.self, parameters: parameters, completion: completion)
    }
}
